/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package projekt;

import java.io.Serializable;

/**
 *
 * @author Mikael
 */
public class HighScore implements Serializable {

    private final int highscoreSize = 8;
    private String[] names = new String[highscoreSize];
    private int[] gold = new int[highscoreSize];

    public HighScore() {
        for (int x = 0; x < 8; x++) {
            names[x] = " ";
        }
        for (int y = 0; y < 8; y++) {
            gold[y] = 0;
        }
    }

    public String[] getNames() {
        return names;
    }

    public String getName(int i) {
        return names[i];
    }

    public int getGold1(int i) {
        return gold[i];
    }

    public void setNames(String[] names) {
        this.names = names;
    }

    public int[] getGold() {
        return gold;
    }

    public void setGold(int[] gold) {
        this.gold = gold;
    }

    public void addScore(String nameX, int goldX) {
        names[7] = names[6];
        names[6] = names[5];
        names[5] = names[4];
        names[4] = names[3];
        names[3] = names[2];
        names[2] = names[1];
        names[1] = names[0];


        gold[7] = gold[6];
        gold[6] = gold[5];
        gold[5] = gold[4];
        gold[4] = gold[3];
        gold[3] = gold[2];
        gold[2] = gold[1];
        gold[1] = gold[0];
        names[0] = nameX;
        gold[0] = goldX;
    }
}
